define("pages/jls_jbxxxx/mainxq", [
	"../../plugins/easyui/jquery-easyui-1.5.1/jquery.easyui.min",	
	"../../plugins/easyui/jquery-easyui-1.5.1/easyloader",
	"../../common/componts",
	],
function(require) {	
	var rybh = $("#rybh").val();
	var gcbh = $("#gcbh").val();
	var flag = false;
	var Ztree = function(rybh,gcbh){
		$('#xqs').tree({
			 onLoadSuccess:function(node, data)  
	            {  
	                $("#xqs").tree("collapseAll"); 
	                if (data.length > 0) {
	                	   var n = $('#xqs').tree('find', data[0].children[0].id);
	                	   $('#xqs').tree('select', n.target);
	                 }
	            },
			onSelect: function (node) {
	            if (node.state == "closed")
	                $(this).tree('expand', node.target);
	            else
	                $(this).tree('collapse', node.target);
	        },
	        onClick:function(node){
	        	title = node.target.innerText;
	        	if (title=="所有人员") {
	        		url = "/jls_jbxxxx/syry.html?rybh="+rybh+"&gcbh="+gcbh;
	        		addTab(title,url);
	        	}else if(title=="健康登记"){
	        		url = "/jls_jbxxxx/jkdj.html?rybh="+rybh+"&gcbh="+gcbh;
	        		addTab(title,url);
	        	}else if(title=="收回人员"){
	        		url = "/jls_jbxxxx/shry.html?rybh="+rybh+"&gcbh="+gcbh;
	        		addTab(title,url);
	        	}else if(title=="社会关系"){
	        		url = "/jls_jbxxxx/shgx.html?rybh="+rybh+"&gcbh="+gcbh;
	        		addTab(title,url);
	        	}else if(title=="羁押信息人员"){
	        		url = "/jls_jbxxxx/jyxxry.html?rybh="+rybh+"&gcbh="+gcbh;
	        		addTab(title,url);
	        	}else if(title=="物品登记"){
	        		url = "/jls_jbxxxx/wpdjxx.html?rybh="+rybh+"&gcbh="+gcbh;
	        		addTab(title,url);
	        	}else if(title=="办案环节"){
	        		url = "/jls_jbxxxx/bahj.html?rybh="+rybh+"&gcbh="+gcbh;
	        		addTab(title,url);
	        	}else if(title=="处理结果"){
                    url = "/jls_jbxxxx/cljg.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="延期"){
                    url = "/jls_jbxxxx/yq.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="律师会见"){
                    url = "/jls_jbxxxx/lshj.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="提解"){
                    url = "/jls_jbxxxx/tj.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="提讯"){
                    url = "/jls_jbxxxx/tx.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="医生巡视"){
                    url = "/jls_jbxxxx/ysxs.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="三类案件设置表"){
                    url = "/jls_jbxxxx/slaj.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="临时出所"){
                    url = "/jls_jbxxxx/lscs.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="人力情报线索信息表"){
                    url = "/jls_jbxxxx/rlqbxs.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="保外就医"){
                    url = "/jls_jbxxxx/bwjy.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="出所表"){
                    url = "/jls_jbxxxx/csb.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="加刑减刑"){
                    url = "/jls_jbxxxx/jxjx.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="医疗卫生管理"){
                    url = "/jls_jbxxxx/ylwsgl.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="奖励表"){
                    url = "/jls_jbxxxx/jlb.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="亲属会见"){
                    url = "/jls_jbxxxx/jshj.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="家属送钱送物"){
                    url = "/jls_jbxxxx/jssqsw.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="寄信表"){
                    url = "/jls_jbxxxx/jxb.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="惩罚表"){
                    url = "/jls_jbxxxx/cfb.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="所外就医"){
                    url = "/jls_jbxxxx/swjy.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="教育登记"){
                    url = "/jls_jbxxxx/jydj.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="暂予监外执行"){
                    url = "/jls_jbxxxx/zyjwzx.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="来信表"){
                    url = "/jls_jbxxxx/lxb.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="械具使用"){
                    url = "/jls_jbxxxx/xjsy.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="死亡表"){
                    url = "/jls_jbxxxx/swb.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="留所"){
                    url = "/jls_jbxxxx/ls.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="监室调整"){
                    url = "/jls_jbxxxx/jstz.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="耳目"){
                    url = "/jls_jbxxxx/em.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="耳目反馈情况"){
                    url = "/jls_jbxxxx/emfkqk.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="逃跑表"){
                    url = "/jls_jbxxxx/tpb.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="重病号"){
                    url = "/jls_jbxxxx/zbh.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="风险评估审批表"){
                    url = "/jls_jbxxxx/fxpg.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }else if(title=="线索查证表"){
                    url = "/jls_jbxxxx/xsczb.html?rybh="+rybh+"&gcbh="+gcbh;
                    addTab(title,url);
                }

	        }
		});
	}
	

	var addTab = function (title, url) {
	    if ($("#tabs").tabs('exists', title)) {
	        $("#tabs").tabs('select', title);
	    } else {
	        var content = '<iframe scrolling="auto" frameborder="0"  src="' + url + '" style="width:100%;height:100%;"></iframe>';
	        $("#tabs").tabs('add', {
	            title: title,
	            content: content,
	            closable: true
	        });
	    }
	}	
	
	var mropen = function(rybh,gcbh){
		url = "/jls_jbxxxx/syry.html?rybh="+rybh+"&gcbh="+gcbh;
		title="所有人员";
		var content = '<iframe scrolling="auto" frameborder="0"  src="' + url + '" style="width:100%;height:100%;"></iframe>';
		$("#mr").prepend(content);
		
	}
	var initView=function(rybh,gcbh){
		Ztree(rybh,gcbh);
		mropen(rybh,gcbh);
	}
	initView(rybh,gcbh);
	
});